<%@ page contentType="text/html; charset=gb2312" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%
	try
	{
%>
<html:html>  
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="<%=request.getContextPath()%>/css/table.css" type=text/css rel=stylesheet />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/parse.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/calendar.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/check.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/itfvalidator.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/page.js"></script>
<jsp:include page="/common/clientCheck.jsp"/>
<title>
	<logic:equal name="RperInfoForm" property="state" scope="request" value="add">

	</logic:equal>  
	<logic:equal name="RperInfoForm" property="state" scope="request" value="edit">

	</logic:equal>  
	
</title>
</head>
<script language="javascript">




var validArr=new Array(
           new Array("rperCode","Require|Max", check_code01+"|"+check_code01, "|50"),
           new Array("rperName","Require|Max", check_code02+"|"+check_code02, "|255"),
           new Array("computerCode","Max", check_code03, "50"),
           new Array("legalPerson","Max", check_code04, "50"),
           new Array("phone","Max", check_code05, "50"),
           new Array("address","Max", check_code06, "255"),
           new Array("manageAddr","Max", check_code07, "255"),
           new Array("manageRange","Max", check_code08, "1000"),
           new Array("personNum","Max", check_code09, "50"),
           new Array("financePer","Max", check_code10, "50"),
           new Array("financePerPhone","Max", check_code11, "50"),
           new Array("rpWorker","Max", check_code12, "50"),
           new Array("rpWorkerPhone","Max", check_code13, "50"),
           new Array("registMoney","Double|Max", check_code14+"|"+check_code14, "|16"),
           new Array("zzjgdmName","Max", check_code15, "50"),
           new Array("yinziBumen","Max", check_code16, "100"),
           new Array("yinziMoney","Int|Max", check_code17+"|"+check_code17, "|9"),
           new Array("yinziNote","Max", check_code18, "255"),
           new Array("affair","Max", check_code19, "255"),
           new Array("confirmUnit","Max", check_code20, "50"),
           new Array("money","Double|Max", check_code21+"|"+check_code21, "|16"),
           new Array("note","Max", check_code22, "255")
           );

function setNameField()
{
	if (document.all.groupId1.value != "")
        document.all.groupName1.value = document.all.groupId1.options[document.all.groupId1.selectedIndex].text;       
  else
  			document.all.groupName1.value = " ";
	if (document.all.groupId2.value != "")
        document.all.groupName2.value = document.all.groupId2.options[document.all.groupId2.selectedIndex].text;       
  else
  			document.all.groupName2.value = " ";
	if (document.all.registTypeId.value != "")
        document.all.registTypeName.value = document.all.registTypeId.options[document.all.registTypeId.selectedIndex].text;       
  else
  			document.all.registTypeName.value = " ";
	if (document.all.tradeId.value != "")
        document.all.tradeName.value = document.all.tradeId.options[document.all.tradeId.selectedIndex].text;       
  else
  			document.all.tradeName.value = " ";
	if (document.all.tradeDetailId.value != "")
        document.all.tradeDetailName.value = document.all.tradeDetailId.options[document.all.tradeDetailId.selectedIndex].text;       
  else
  			document.all.tradeDetailName.value = " ";
	if (document.all.zongjigouBiaozhiId.value != "")
        document.all.zongjigouBiaozhiName.value = document.all.zongjigouBiaozhiId.options[document.all.zongjigouBiaozhiId.selectedIndex].text;       
  else
  			document.all.zongjigouBiaozhiName.value = " ";
	if (document.all.rperStateId.value != "")
        document.all.rperStateName.value = document.all.rperStateId.options[document.all.rperStateId.selectedIndex].text;       
  else
  			document.all.rperStateName.value = " ";
	if (document.all.marketId.value != "")
        document.all.marketName.value = document.all.marketId.options[document.all.marketId.selectedIndex].text;       
  else
  			document.all.marketName.value = " ";
}

function saveAdd(state)
{
    if ( checkValid())
    {
    	setNameField();
        document.forms[0].state.value = state;
       // document.forms[0].submit();    
    }
}           

function saveAdd(state)
{
    if ( checkValid())
    {
        setNameField();
        document.forms[0].state.value = state;
        document.forms[0].submit();    
    }
}           

function setZhaoshang(isZhaoshang)
{
	if (!document.all.isZhaoshang.value == "0")
	{
		document.all.trZhaoshang1.style.display = "none";	
		document.all.trZhaoshang2.style.display = "none";
	}	
	if (document.all.isZhaoshang.value == "1")
	{
		
		document.all.trZhaoshang1.style.display = "";	
		document.all.trZhaoshang2.style.display = "";
	}	
}

function setJianmian(isJianmian)
{
	if (!document.all.isJianmian.value == "0")
	{
		document.all.tab_main.rows(29).style.display = "none";
		document.all.tab_main.rows(30).style.display = "none";
		document.all.tab_main.rows(31).style.display = "none";
		document.all.tab_main.rows(32).style.display = "none";	
	}	
	if (document.all.isJianmian.value == "1")
	{	
		document.all.tab_main.rows(29).style.display = "";
		document.all.tab_main.rows(30).style.display = "";
		document.all.tab_main.rows(31).style.display = "";
		document.all.tab_main.rows(32).style.display = "";	
	}	
}

function init()
{
	var al = document.all;

	if (al.state.value == "add" ||  
	 al.isZhaoshang_page.value == "0" || al.isZhaoshang_page.value == "")
	{
//		document.all.trZhaoshang1.style.display = "none";	
//		document.all.trZhaoshang2.style.display = "none";	
		
    	document.all.tab_main.rows(26).style.display = "none";	
		document.all.tab_main.rows(27).style.display = "none";

	}	

	if (al.state.value != "add" && al.isZhaoshang_page.value == "1")
	{
//		document.all.trZhaoshang1.style.display = "";	
//		document.all.trZhaoshang2.style.display = "";	

    	document.all.tab_main.rows(26).style.display = "";	
		document.all.tab_main.rows(27).style.display = "";

	}	
	
	if (al.state.value == "add" ||  
	 al.isJianmian_page.value == "0" || al.isJianmian_page.value == "")
	{
		document.all.tab_main.rows(29).style.display = "none";
		document.all.tab_main.rows(30).style.display = "none";
		document.all.tab_main.rows(31).style.display = "none";
		document.all.tab_main.rows(32).style.display = "none";	
	}	

	if (al.state.value != "add" && al.isJianmian_page.value == "1")
	{
		document.all.tab_main.rows(29).style.display = "";
		document.all.tab_main.rows(30).style.display = "";
		document.all.tab_main.rows(31).style.display = "";
		document.all.tab_main.rows(32).style.display = "";	
	}	
}

function groupId1Change(groupId1)
{
    var arrObj = new Array();
    arrObj[0] = document.all.spanGroupId2;
    makeRequest("<%=request.getContextPath()%>/rperInfoAction.do?state=groupId1Change&seaGroupId1=" + groupId1,
        arrObj);

    var arrObj2 = new Array();
    arrObj2[0] = document.all.spanMarketId;
    makeRequest("<%=request.getContextPath()%>/rperInfoAction.do?state=groupId1Change2&seaGroupId1=" + groupId1,
        arrObj2);

}

function groupId2Change(groupId2)
{
	return false;
    var arrObj = new Array();
    arrObj[0] = document.all.spanMarketId;
    makeRequest("<%=request.getContextPath()%>/rperInfoAction.do?state=groupId2Change&seaGroupId2=" + groupId2,
        arrObj);
}


function tradeIdChange(tradeId)
{
    var arrObj = new Array();
    arrObj[0] = document.all.spanTradeDetailId;
    makeRequest("<%=request.getContextPath()%>/rperInfoAction.do?state=tradeIdChange&seaTradeId=" + tradeId,
        arrObj);
}
</script>
<body onLoad="init()">
<html:form action="/rperInfoAction" onsubmit="return checkValid();">


    
<html:hidden  property="state"/>
<html:hidden  property="pageno"/>  
<html:hidden  property="pagesize"/>  
<html:hidden  property="id"/>  

<html:hidden  property="isThisMonth"/>  


<html:hidden  property="isHighSearch"/>  
<html:hidden  property="seaRperCode"/>  
<html:hidden  property="seaGroupId1"/>  
<html:hidden  property="seaGroupId2"/>  
<html:hidden  property="seaRperName"/>  
<html:hidden  property="seaTradeId"/>  
<html:hidden  property="seaTradeDetailId"/>  
<html:hidden  property="seaIsZhaoshang"/>  
<html:hidden  property="seaMarketId"/>  
<html:hidden  property="seaLegalPerson"/>  
<html:hidden  property="seaZongjigouBiaozhiId"/>  
<html:hidden  property="seaRperStateId"/>  
<html:hidden  property="seaRperStateId"/>  
<html:hidden  property="seaIsJizhong"/>  
<html:hidden  property="seaIsLietong"/> 
<html:hidden  property="seaIsImportant"/>
<html:hidden  property="seaIsJianmian"/>  
<html:hidden  property="seaIsTuishui"/>  
	
<html:hidden  property="seaIsShiXiahua"/>  


<table width="100%"  border="0" cellspacing="0">
  <tr>
    <td><span id="title"></span></td>
  </tr>
</table>

<input type="hidden" name="isZhaoshang_page" 
    	value="<bean:write name="RperInfoForm" property="isZhaoshang" filter="false"/>">
<input type="hidden" name="isJianmian_page" 
    	value="<bean:write name="RperInfoForm" property="isJianmian" filter="false"/>">
<span id="addinfo"> 

<table width="600"  border="0" cellspacing="0" cellpadding="0" align="center" class="oprTableClass" id="tab_main">
  <tr height=""> 
    <th  colspan="4" class="formHead"> &nbsp;&nbsp; <logic:equal name="RperInfoForm" property="state" scope="request" value="add"> 




  </tr>
  <tr  > 

      </font></b></td>
  </tr>
  <tr > 

    <td class="formControl" nowrap><html:text property="rperCode"/> <font color="red">*</font>&nbsp;</td>

    <td class="formControl"><html:text property="computerCode"/>&nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl" nowrap colspan="3"><html:text property="rperName" size="76"/><font color="red">*</font></td>
  </tr>
  <tr > 

    <td class="formControl"><html:text property="legalPerson" />&nbsp;</td>

    <td class="formControl"><html:text property="phone"/>&nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl" colspan="3"> <html:text property="address" size="76"/>&nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl" colspan="3"><html:text property="manageAddr" size="76"/>&nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl" colspan="3"> <html:textarea property="manageRange" rows="3" style="width:535;" > 

  </tr>
  <tr > 

    <td class="formControl"> <bean:write name="registTypeId" filter="false"/><html:hidden property="registTypeName"/>&nbsp;</td>

    <td class="formControl"><html:text property="personNum"/>&nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl"><html:text property="financePer"/>&nbsp;</td>

    <td class="formControl"><html:text property="financePerPhone"/>&nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl"><html:text property="rpWorker"/>&nbsp;</td>

    <td class="formControl"><html:text property="rpWorkerPhone"/>&nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl"><html:text property="registMoney"/> &nbsp;</td>

    <td nowrap  class="formControl"><html:text property="registDate"/> 
      <input type="image" src="<%=request.getContextPath()%>/image/calendar.gif" width="18" height="17" 

      &nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl"><html:text property="zzjgdmName"/> &nbsp;</td>

    <td class="formControl"><bean:write name="zongjigouBiaozhiId" filter="false"/> 
      <html:hidden property="zongjigouBiaozhiName"/> &nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl"><bean:write name="rperStateId" filter="false"/> <html:hidden property="rperStateName"/> 
      &nbsp;</td>
    <td class="formText2" bgcolor="cddefc">&nbsp;</td>
    <td class="formControl">&nbsp;</td>
  </tr>
  <tr > 

  </tr>
  <tr > 

    <td class="formControl" colspan="3"><bean:write name="groupId1" filter="false"/><html:hidden property="groupName1"/>&nbsp;<span id="spanGroupId2"> 
      <bean:write name="groupId2" filter="false"/></span> <html:hidden property="groupName2"/></td>
  </tr>
  <tr > 

    <td class="formControl" colspan="3"> <bean:write name="tradeId" filter="false"/><html:hidden property="tradeName"/>&nbsp; 
      <span id="spanTradeDetailId"><bean:write name="tradeDetailId" filter="false"/></span><html:hidden property="tradeDetailName"/></td>
  </tr>
  <tr > 

    <td class="formControl" colspan="3"> <span id="spanMarketId"><bean:write name="marketId" filter="false"/></span><html:hidden property="marketName"/>&nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl"><bean:write name="isJizhong" filter="false"/> &nbsp;</td>

    <td class="formControl"><bean:write name="isLietong" filter="false"/> &nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl"><bean:write name="isImportant" filter="false"/> &nbsp;</td>

    <td class="formControl"><bean:write name="isGuimo" filter="false"/> &nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl"><bean:write name="isShiXiahua" filter="false"/>&nbsp;</td>

    <td class="formControl"><bean:write name="isTuishui" filter="false"/>&nbsp;</td>
  </tr>
  <tr >

    <td class="formControl"><bean:write name="isYicheng" filter="false"/>&nbsp;</td>

    <td class="formControl"><bean:write name="isSiying" filter="false"/>&nbsp;</td>
  </tr>
  <tr >

    <td class="formControl"><bean:write name="isXian" filter="false"/>
      &nbsp;</td>

    <td class="formControl"><bean:write name="isOther1" filter="false"/>
      &nbsp;</td>
  </tr>
  <tr >

    <td class="formControl"><bean:write name="isShuidukou" filter="false"/>
      &nbsp;</td>

    <td class="formControl"><bean:write name="isOther2" filter="false"/>
      &nbsp;</td>
  </tr>
  <tr >

    <td class="formControl"><bean:write name="isXiqu" filter="false"/>
      &nbsp;</td>
    <td bgcolor="cddefc" class="formText2">&nbsp;</td>
    <td class="formControl">&nbsp;</td>
  </tr>
  <tr > 

    <td class="formControl"><bean:write name="isZhaoshang" filter="false"/> 
      &nbsp;</td>
    <td class="formControl">&nbsp;</td>
    <td class="formControl">&nbsp;</td>
  </tr>
  <tr id="trZhaoshang1" name="trZhaoshang1" bgcolor="d0dae3" > 

    <td class="formControl" bgcolor="d0dae3"><html:text property="yinziBumen"/>&nbsp;</td>

    <td class="formControl" bgcolor="d0dae3"><html:text property="yinziMoney"/>&nbsp;</td>
  </tr>
  <tr id="trZhaoshang2" name="trZhaoshang2" > 

    <td colspan="3" bgcolor="d0dae3" class="formControl"><html:textarea property="yinziNote" rows="3" style="width:535;" > 

  </tr>
  <tr > 

    <td colspan="3" class="formControl"><bean:write name="isJianmian" filter="false"/>&nbsp;</td>
  </tr>
  <tr bgcolor="d0dae3" > 

    <td class="formControl" bgcolor="d0dae3"><html:text property="affair"/>&nbsp;</td>

    <td class="formControl" bgcolor="d0dae3"><html:text property="confirmUnit"/>&nbsp;</td>
  </tr>
  <tr bgcolor="d0dae3" > 

    <td class="formControl" nowrap bgcolor="d0dae3"><html:text property="confirmDatePage"/> 
      <input type="image" src="<%=request.getContextPath()%>/image/calendar.gif" width="18" height="17" 

      &nbsp;</td>

    <td class="formControl" nowrap bgcolor="d0dae3"><html:text property="endDatePage"/> 
      <input type="image" src="<%=request.getContextPath()%>/image/calendar.gif" width="18" height="17" 

      &nbsp;</td>
  </tr>
  <tr bgcolor="d0dae3" > 

    <td class="formControl" bgcolor="d0dae3"><html:text property="money"/>&nbsp;</td>
    <td class="formText2" bgcolor="d0dae3">&nbsp;</td>
    <td class="formControl" bgcolor="d0dae3">&nbsp;</td>
  </tr>
  <tr  > 

    <td colspan="3" class="formControl" bgcolor="d0dae3"><html:textarea property="note" rows="3" style="width:535;" > 

  </tr>
  <%--
  <tr> 

    <td class="formControl"><bean:write name="isDishuiRegist" filter="false"/>&nbsp;</td>

    <td class="formControl"><bean:write name="isGuoshuiRegist" filter="false"/>&nbsp;</td>
  </tr>
  --%> 
</table>
</span> 

<br>

<table width="100" border="0" cellspacing="0" align="center">
  <tr>
  
	<logic:equal name="RperInfoForm" property="state" scope="request" value="add">
      <th><a ><a href="###" 
        onclick="saveAdd('saveAdd');">
      	<img src="<%=request.getContextPath()%>/image/icon04.gif" align="middle" border="0" ></a></a></th>
      <th><a href="javascript:document.all.state.value='add';document.forms[0].submit()" >
      	<img src="<%=request.getContextPath()%>/image/icon05.gif" align="middle" border="0"></a></th>
      <th><a href="javascript:document.all.state.value='search';document.forms[0].submit()">
            <img src="<%=request.getContextPath()%>/image/icon06.gif" align="middle" border="0" ></a></th>
	</logic:equal>  
	
	<logic:equal name="RperInfoForm" property="state" scope="request" value="edit">
      <th><a href="###" 
        onclick="javascript:saveAdd('saveEdit');">
        <img src="<%=request.getContextPath()%>/image/icon04.gif" align="middle" border="0" ></a></th>
      <th><a href="javascript:document.all.state.value='edit';document.forms[0].submit()" >
        <img src="<%=request.getContextPath()%>/image/icon05.gif" align="middle" border="0"></a></th>
      <th>        
        <a href="javascript:document.all.state.value='search';document.forms[0].submit()">
            <img src="<%=request.getContextPath()%>/image/icon06.gif" align="middle" border="0" ></a></th>
	</logic:equal>  
	
	<logic:equal name="RperInfoForm" property="state" scope="request" value="saveAdd">
      <th>
        <a href="javascript:document.all.state.value='search';document.forms[0].submit()">
            <img src="<%=request.getContextPath()%>/image/icon06.gif" align="middle" border="0" ></a></th>
	</logic:equal>  
	
	<logic:equal name="RperInfoForm" property="state" scope="request" value="saveEdit">
      <th>
        <a href="javascript:document.all.state.value='search';document.forms[0].submit()">
            <img src="<%=request.getContextPath()%>/image/icon06.gif" align="middle" border="0" ></a></th>
	</logic:equal>  
  </tr>
</table>

<script language="javascript">
		replaceHtml('&nbsp;',addinfo);
	<logic:equal name="RperInfoForm" property="state" scope="request" value="saveAdd">

	</logic:equal>  
	<logic:equal name="RperInfoForm" property="state" scope="request" value="saveEdit">

	</logic:equal>  
</script >

</body>
</html:form>
</html:html>


<%
	}
	catch(Exception e)
	{
		out.println(e.getMessage());
	}
%>